#!/bin/bash
set -e
echo '==========================='
echo 'Build Modes'
echo '------'
echo 'Java 8'
echo ' 1. Full build with tests'
echo ' 2. Fast build with no tests'
echo '------'
echo 'Java 11 or higher'
echo ' 3. Full build with tests'
echo ' 4. Fast build with no tests'
echo '------'
echo ' 5. Exit'
echo '==========================='
echo -n 'Enter build mode: '
read mode
if [[ $mode == '1' ]]; then
  ./mvnw clean package;
elif [[ $mode == '2' ]]; then
  ./mvnw clean package -Dmaven.test.skip -Dcheckstyle.skip;
elif [[ $mode == '3' ]]; then
  ./mvnw clean package -P java11;
elif [[ $mode == '4' ]]; then
  ./mvnw clean package -Dmaven.test.skip -Dcheckstyle.skip -P java11;
fi;